export default function({
  $axios,
  redirct,
  route,
  store
}) {

  $axios.defaults.timeout = 10000

  $axios.onRequest(config => {
    config.headers.token = store.state ? store.state : null
    console.log("请求拦截 config = ", config)
    // console.log(config)
    return config
  })

  $axios.onResponse(res => {
    console.log("响应拦截")
    console.log(res)
    return res
  })

  $axios.onError(error => {
    console.log("请求异常 error = ", error)
    return error
  })

}
